//
//  EredarTableViewCell.m
//  HandWork
//
//  Created by 王阳阳 on 16/1/23.
//  Copyright © 2016年 www.lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "EredarTableViewCell.h"
#import "AFNnetWork.h"
#import "EredarModel.h"
@interface EredarTableViewCell ()
@property (nonatomic, retain) NSMutableArray *dataArr;//collectionView的数据
@property (nonatomic, retain) NSMutableArray *tempArr;
@end

@implementation EredarTableViewCell
-(void)dealloc
{
    [_touxiang release];
    [_name release];
    [_courseAndhandWork release];
    [_collimg release];
    [super dealloc];
}
#pragma mark - 初始化
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self creat];
        
    }
    return self;
}
-(void)creat
{
    //头像
    self.touxiang = [[UIImageView alloc]init];
    [self.contentView addSubview:self.touxiang];
    [_touxiang release];
    //名字
    self.name = [[UILabel alloc]init];
    [self.contentView addSubview:self.name];
    [_name release];
    //教程 和手工圈 拼接
    self.courseAndhandWork = [[UILabel alloc]init];
    [self.contentView addSubview:self.courseAndhandWork];
    [_courseAndhandWork release];
 

//    [self imgcreat];
    
}
- (void)layoutSubviews
{
    [super layoutSubviews];
    self.touxiang.frame = CGRectMake(5, 5, self.contentView.frame.size.width / 7, self.contentView.frame.size.width / 7);
    self.touxiang.layer.cornerRadius = self.contentView.frame.size.width / 7 / 2;
    self.touxiang.clipsToBounds =  YES;
//    self.touxiang.backgroundColor = [UIColor redColor];
    
    self.name.frame = CGRectMake(self.touxiang.frame.size.width + 20, 5, self.contentView.frame.size.width / 3, 30);
//    self.name.backgroundColor = [UIColor orangeColor];
    
    self.courseAndhandWork.frame =  CGRectMake(self.touxiang.frame.size.width *3, self.name.frame.size.height + 10, self.contentView.frame.size.width / 2, 20);
//    self.courseAndhandWork.backgroundColor = [UIColor cyanColor];
    self.courseAndhandWork.font = [UIFont systemFontOfSize:14];
    
    
}
//-(void)setModel:(EredarModel*)model
//{
//    if (_ere != model) {
//        
//        
//        [_ere release];
//        _ere= [model retain];
//        
//    }
//    [self imgcreat];
//    
//}
//
//- (void)imgcreat
//{
////    [self data];
//    self.layout = [[UICollectionViewFlowLayout alloc]init];
//    self.layout.minimumInteritemSpacing = 0;
//    self.layout.minimumLineSpacing = 0;
//    self.layout.itemSize = CGSizeMake([UIScreen mainScreen].bounds.size.width / 3 - 5,[UIScreen mainScreen].bounds.size.width / 3 - 5);
////    self.collimg.frame = CGRectMake(0, self.contentView.frame.size.height - self.contentView.frame.size.width / 7 - 20, self.contentView.frame.size.width, self.contentView.frame.size.height - self.contentView.frame.size.width / 7 - 20);
//    self.collimg = [[UICollectionView alloc]initWithFrame:CGRectMake(0, 70, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.width / 3 - 5) collectionViewLayout:self.layout];
//    [self.contentView addSubview:self.collimg];
//    self.collimg.backgroundColor = [UIColor whiteColor];
//    self.collimg.delegate = self;
//    self.collimg.dataSource = self;
//    [self.contentView addSubview:self.collimg];
//    [_collimg registerClass:[EredarheaderCollectionViewCell class] forCellWithReuseIdentifier:@"cell"];
//    [_collimg release];
//    [_layout release];
//}
//#pragma mark - collectionView比粗实线的两个方法
//- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
//{
//    return _ere.imageArr.count;
//}
//- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
//{
//    EredarheaderCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"cell" forIndexPath:indexPath];
//    [cell.img sd_setImageWithURL:[NSURL URLWithString:_ere.imageArr[indexPath.item]]];//图片
//    return cell;
//}
//-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
//{
//    [self.delegate clickCell];
//}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/


@end

